package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** Chapter数据管理 */
public class ChapterDBModel extends AbstractDBModel<ChapterDBModel, ChapterEntity>
{
    private static ChapterDBModel instance;

    public static ChapterDBModel getInstance() {
        if (instance == null) {
            instance = new ChapterDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "Chapter.data";
    }

    /** 创建实体 */
    @Override
    protected ChapterEntity MakeEntity(GameDataTableParser parse)
    {
        ChapterEntity entity = new ChapterEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.ChapterName = parse.GetFieldValue("ChapterName");
        entity.GameLevelCount = parse.GetFieldValueToInt("GameLevelCount");
        entity.BG_Pic = parse.GetFieldValueToUTF8String("BG_Pic");
        entity.Uvx = parse.GetFieldValueToFloat("Uvx");
        entity.Uvy = parse.GetFieldValueToFloat("Uvy");
        return entity;
    }
}
